<?php

namespace Frieza\Modules\Position\Controllers;

use Encore\Admin\Grid;
use Encore\Admin\Widgets\Form;


class Tab2DesignerBannerController extends BaseController
{
    use BaseTrait;

    public function extendList(Grid $grid)
    {
        $grid->column('pos', '位置');
        $grid->column('pic_url', '图片')->image();
    }

    public function beforeTitleForm(Form $form)
    {
        $seed = range(1, 20);
        $form->select('base.pos', '位置')->options(array_combine($seed, $seed));
    }

    public function beforeLinkForm(Form $form)
    {
        $form->imgUpload('base.pic_id', 'banner图');
    }
}
